<% if session[:user] -%>
<p> User:&nbsp;<%= h(session[:user].name) %>
<% form_tag :controller => 'auth', :action => 'logout' do -%>
  <%= submit_tag "Logout" %>
<% end %>
</p>

<% else -%>
<h1>Login</h1>

<% if flash[:notice] -%>
   <div id="ErrorExplanation"><%= flash[:notice] %></div>
<% end -%>

<% form_tag :controller => 'auth', :action => 'login' do -%>
    <p><label for="login_name">Name</label><br/>
    <%= text_field 'login', 'name', :size => 12 %></p>

    <p><label for="login_password">Password</label><br/>
    <%= password_field 'login', 'password', :size => 12 %></p>

  <%= submit_tag "Login" %>
<% end %>
<p><%= link_to "Forgotten your password?", 
       :controller => 'auth', :action => 'forgotten' %></p>
<% end %>